package tienmanh.gs.goldminer.scene;

import javax.microedition.khronos.opengles.GL10;

import org.andengine.engine.handler.timer.ITimerCallback;
import org.andengine.engine.handler.timer.TimerHandler;
import org.andengine.entity.IEntity;
import org.andengine.entity.modifier.AlphaModifier;
import org.andengine.entity.modifier.SequenceEntityModifier;
import org.andengine.entity.modifier.IEntityModifier.IEntityModifierListener;
import org.andengine.entity.particle.Particle;
import org.andengine.entity.particle.ParticleSystem;
import org.andengine.entity.scene.background.SpriteBackground;
import org.andengine.entity.sprite.AnimatedSprite;
import org.andengine.entity.sprite.Sprite;
import org.andengine.util.modifier.IModifier;

import tienmanh.gs.goldminer.base.BaseScene;
import tienmanh.gs.goldminer.manager.SceneManager;
import tienmanh.gs.goldminer.manager.SceneManager.SceneType;
import tienmanh.gs.goldminer.sprite.load.LoadBag;

public class LoadScene extends BaseScene{

//	Particle<AnimatedSprite> particleSystem;
	private Sprite bgSG;
	  private SpriteBackground bgScreenGoal;
	  private SequenceEntityModifier lemRun;
	@Override
	public void createScene() {
		// TODO Auto-generated method stub
		camera.setCenter(400, 240);
		this.bgSG = new Sprite(0.0F, 0.0F, 800, 480, this.resourcesManager.textureRegionLevelBackground, this.vbom);
	    this.bgScreenGoal = new SpriteBackground(this.bgSG);
	     setBackground(bgScreenGoal);
	    LoadBag bag = new LoadBag(400 - 350/2, 240 - 200/2, resourcesManager.TextureRegionBagLoad, vbom, "Yêu cầu : 1000$");
	    attachChild(bag);
	    
	    final SequenceEntityModifier entityModifier = new SequenceEntityModifier(
				new IEntityModifierListener() {
					@Override
					public void onModifierStarted(
							final IModifier<IEntity> pModifier,
							final IEntity pItem) {
					}

					@Override
					public void onModifierFinished(
							final IModifier<IEntity> pEntityModifier,
							final IEntity pEntity) {
						
						SceneManager.getInstance().loadGameScene(engine);
					}
				}, new AlphaModifier(3, 0f, 1f));
		bag.registerEntityModifier(entityModifier);
	    
	}

	@Override
	public void onBackKeyPressed() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public SceneType getSceneType() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void disposeScene() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onPauseGame() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onResumeGame() {
		// TODO Auto-generated method stub
		
	}

}
